#!/usr/bin/ruby -w
# -*- coding: UTF-8 -*-

=begin 
@author = sirius
@time = 2017.11.12
=end

names = Array.new(20)
puts names.size  # 返回 20
puts names.length # 返回 20

names = Array.new(4, "mac")
puts "#{names}"

nums = Array.new(10) { |e| e = e * 2 }
puts "#{nums}"


nums = Array.[](1, 2, 3, 4, 5)
nums = Array[1, 2, 3, 4, 5]

digits = Array(0..9)
puts "#{digits}"
num = digits.at(6)
puts "#{num}"
